package base_grammar

import "fmt"

type Person4 struct {
	id, age int
	name    string
	email   string
}

func struct_f1() {
	var tom Person4
	fmt.Printf("tom: %v\n", tom)
	tom = Person4{}
	fmt.Printf("tom: %v\n", tom)

	tom.id = 1
	tom.email = "101010@qq.com"
	fmt.Printf("tom: %v\n", tom)

	// 匿名结构体
	var dog struct {
		id   int
		name string
	}
	dog.id = 111
	dog.name = "huahua"
	fmt.Printf("dog: %v\n", dog)
}
